><

Creating IDs



Unlike classes, which you can apply to an unlimited number of elements, IDs let you embed a specific style for a unique paragraph or range of text in your document. Use IDs for a headline with special formatting or any other text that needs unique treatment.

To create a style based on an ID:

1 With the Style Sheet window in the foreground, click the New ID button () in the Style Sheet toolbar. The new style is listed under its style sheet, with its name selected.

2 In the Basics tab () of the CSS Selector Inspector, type a unique ID name in the Name text box--for example, #myheaderid, and press Enter.

You can use any alphanumeric character string with a leading pound sign (#) as the ID name. ID names may not contain spaces.

3 In the CSS Selector Inspector add style properties. See Defining style properties.

4 Applying the ID style requires that you hand-edit the source code of your page. See Applying styles.


Using Cascading Style Sheets > Creating a style sheet > Creating IDs